/**
 * OEM端的接口
 * 
 * @Author: baiyuxin
 * @Date: 2019-9-23
 * @Last Modified by:   baiyuxin
 * @Last Modified time: 2019-9-23 14:35:22
 */
import axios from '@/api/fetch';
import * as types from '../types';
import SERVER from '@/api/server';

//OEM端

//查询全部列表（自定义数据过滤）@1
export const findPage = params => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach`,{params,menuId:'-1'});

export const getDetails = (id,params) => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/${id}`,{params});

// //添加（主表）
// export const addData = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach`,params);

// //修改（主表）
// export const editData = (id,params) => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/${id}`,params);

//添加（主表）
export const addAllData = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveAll`,params);
//添加（主表） 服务
export const addAllData4Serv = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveAll/service`,params);

//修改（主表）
export const editAllData = (id,params) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveAll/${id}`,params);
//修改（主表） 服务
export const editAllData4Serv = (id,params) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveAll/service/${id}`,params);

// //添加（授权车型子表）
// export const addDealerAttachModelData = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttachModel`,params);

// //修改（授权车型子表）
// export const editDealerAttachModelData = (id,params) => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttachModel/${id}`,params);

// //添加（授权形式）
// export const addDealerAttachAuthData = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttachAuth`,params);

// //修改（授权形式）
// export const editDealerAttachAuthData = (id,params) => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttachAuth/${id}`,params);

//添加的同时生成账号
export const addDetermine = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveDetermineEnable`,params);

//修改的同时生成账号
export const editDetermine = (id,params) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveDetermineEnable/${id}`,params);

export const editDetermineChange = (id,params,changeParams) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveDetermineChange/${id}`,params);

//添加并审核（不可能会有）
export const addAllExamine = params => axios.post(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveAllExamine`,params);

//修改的并审核
export const editAllExamine = (id,params) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/saveAllExamine/${id}`,params);

//查询经销商形式
export const findFinanceCompany = params => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/message/financeCompany/getList`,{params,menuId:'-1'});

//查询经销商变更信息列表
// export const findDealerInfoChangeList = params => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttachLog`,{params,menuId:'-1'});
export const findDealerInfoChangeList = params => axios.get(`${SERVER.CMSCLOUD_CHANNEL}/dealerChangeHistory/dealerChangeHistory`, { params, menuId: '-1' });

//修改的并财务审核
export const editBankAllExamine = (id,params) => axios.put(`${SERVER.CMSCLOUD_CHANNEL}/message/dealerAttach/bankExamine/${id}`,params);
